package live

import (
	"vrcm/src/vrcm/common/models"
)

type RecordListView struct {
	models.Model

	TenantId     string `json:"tenant_id" gorm:"type:varchar(35);comment:租户"`
	BasicId      int    `json:"basic_id" gorm:"type:int unsigned;comment:直播间基本信息id"`
	LiveId       string `json:"live_id" gorm:"type:varchar(50);comment:直播id"`
	RecordId     string `json:"record_id" gorm:"type:varchar(50);comment:录制记录id"`
	TaskId       string `json:"task_id" gorm:"type:varchar(50);comment:录制任务id"`
	RecordUrl    string `json:"record_url" gorm:"type:varchar(500);comment:录制视频地址"`
	FileName     string `json:"file_name" gorm:"type:varchar(100);comment:文件名"`
	FileType     string `json:"file_type" gorm:"type:varchar(20);comment:文件类型"`
	Duration     int64  `json:"duration" gorm:"type:int;comment:持续时间"`
	FileTime     int64  `json:"file_time" gorm:"type:int;comment:文件生成时间"`
	LogoUrl      string `json:"logo_url" gorm:"type:varchar(300);comment:封面图地址"`
	Sort         int    `json:"sort" gorm:"type:int;comment:排序"`
	OperatorType int    `json:"operator_type" gorm:"type:tinyint;comment:操作类型 1 录制 2上传"`
	IsConfirm    int    `json:"is_confirm" gorm:"type:int;comment:来源是否确认录制 1是 2否"`
	Introduction string `json:"introduction" gorm:"type:varchar(1000);comment:简介"`
	models.ModelTime
	models.ControlBy
}

func (RecordListView) TableName() string {
	return "record_list_view"
}

func (e *RecordListView) Generate() models.ActiveRecord {
	o := *e
	return &o
}

func (e *RecordListView) GetId() interface{} {
	return e.Id
}

type RecordList struct {
	models.Model

	TenantId   string `json:"tenant_id" gorm:"type:varchar(35);comment:租户"`
	BasicId    int    `json:"basic_id" gorm:"type:varchar(35);comment:基本信息id"`
	LiveId     string `json:"live_id" gorm:"type:varchar(50);comment:直播id"`
	FileId     string `json:"file_id" gorm:"type:varchar(100);comment:文件id"`
	RecordId   string `json:"record_id" gorm:"type:varchar(50);comment:录制记录id"`
	TaskId     string `json:"task_id" gorm:"type:varchar(50);comment:录制任务id"`
	RecordUrl  string `json:"record_url" gorm:"type:varchar(300);comment:录制视频地址"`
	FileName   string `json:"file_name" gorm:"type:varchar(100);comment:文件名"`
	FileType   string `json:"file_type" gorm:"type:varchar(20);comment:文件类型"`
	Duration   int64  `json:"duration" gorm:"type:int;comment:持续时间"`
	FileTime   int64  `json:"file_time" gorm:"type:int;comment:文件生成时间"`
	FileImg    string `json:"file_img" gorm:"type:varchar(500);comment:文件封面"`
	CreateTime int64  `json:"create_time" gorm:"type:int;comment:创建时间"`
	UpdateTime int64  `json:"update_time" gorm:"type:int;comment:修改时间"`
	IsShow     int64  `json:"is_show" gorm:"-"`
	models.ControlBy
}

type RecordListModel struct {
	Record RecordList `json:"record" comment:"文件类型"`
	IsShow int        `json:"is_show" comment:"是否显示 1显示 2不显示"`
}

func (RecordList) TableName() string {
	return "record_list"
}

type RecordListViewByTime struct {
	YearData   []RecordListView `json:"year_data"`
	MonthData  []RecordListView `json:"month_data"`
	WeekData   []RecordListView `json:"week_data"`
	YearCount  int              `json:"year_count"`
	MonthCount int              `json:"month_count"`
	WeekCount  int              `json:"week_count"`
}
